/* =============整体框架样式============= */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    list-style-type: none;
}
body {
    height: 100vh;
    display: flex;
    flex-direction: column;
}
header {
    height: 50px;
    padding: 0 10vw;
    margin-bottom: 5px;
    background-color: #fff;
    color: #333;
    box-shadow: 0px 1px 8px 4px #0000008b;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
main {
    background-color: #eee;
    padding: 0 10vw;
    display: flex;
    flex-direction: column;
    flex: 1;
}
footer {
    height: 50px;
    background-color: #333;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =============头部样式============= */
header h2 {
    color: red;
    margin-right: auto;
}
header p {
    margin-left: 15px;
}
header .user {
    color: red;
}
header .top {
    cursor: pointer;
}
header .top span {
    border: none;
    background-color: #ff4040;
    color: #fff;
    border-radius: 50%;
    height: 16px;
    width: 16px;
    margin: 1px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    display: none;
}
.top:hover {
    background-color: red;
    color: #fff;
}

/* =============主体样式============= */

/* =============购物车============= */
main h3 {
    margin: 20px 0 10px;
    font-size: 20px;
    color: #333;
}

.cart-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.cart-list li img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.name {
    margin: 2px 0;
    font-size: 15px;
    color: #333;
}
.price {
    color: #ff4040;
    font-weight: 600;
}

.cart-list button {
    width: 26px;
    height: 26px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: .2s;
}
.cart-list button:hover {
    border-color: #ff4040;
    color: #ff4040;
}
.cart-list button:last-of-type {
    width: auto;
    padding: 0 10px;
    font-size: 12px;
    background: #ff4040;
    color: #fff;
    border: none;
}
.cart-list button:last-of-type:hover {
    background: #e60000;
}

.cart-total {
    margin-top: 20px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    font-size: 16px;
}
.total-price {
    color: #333;
    margin-right: auto;
}
.cart-total button {
    padding: 8px 24px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ff4040);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: .25s;
}
.cart-total button:hover {
    background: linear-gradient(135deg, #ff4040, #e60000);
}
